import 'package:json_annotation/json_annotation.dart';

part 'task_data.g.dart';

/// @Author lixiaobin
/// @Date 2024/3/12
/// @Description
@JsonSerializable(explicitToJson: true)
class TaskItemDataModel {
  String? name;
  String? code;
  int? sort;
  int? total;
  String? colourValue;
  String? taskName;
  String? taskType;
  List<TaskItemDataModel>? items;

  static TaskItemDataModel fromJson(Map<String, dynamic> srcJson) =>
      _$TaskItemDataModelFromJson(srcJson);

  Map<String, dynamic> toJson() => _$TaskItemDataModelToJson(this);
}

@JsonSerializable(explicitToJson: true)
class TaskTotalModel {
  String? name;
  String? code;
  int? value;
  String? desc;
  int? sort;

  static TaskTotalModel fromJson(Map<String, dynamic> srcJson) => _$TaskTotalModelFromJson(srcJson);

  Map<String, dynamic> toJson() => _$TaskTotalModelToJson(this);
}

@JsonSerializable(explicitToJson: true)
class TaskTypeDataModel {
  List<TaskItemDataModel>? itemDesc;
  List<TaskItemDataModel>? itemData;

  static TaskTypeDataModel fromJson(Map<String, dynamic> srcJson) =>
      _$TaskTypeDataModelFromJson(srcJson);

  Map<String, dynamic> toJson() => _$TaskTypeDataModelToJson(this);
}

@JsonSerializable(explicitToJson: true)
class TaskDataCountModel {
  List<TaskTotalModel>? totalList;
  TaskTypeDataModel? data;

  static TaskDataCountModel fromJson(Map<String, dynamic> srcJson) =>
      _$TaskDataCountModelFromJson(srcJson);

  Map<String, dynamic> toJson() => _$TaskDataCountModelToJson(this);
}
